import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path:"/",
        redirect:"/login"
    },
	{
		path:"/login",
		name:"login",
		component:()=>import("@/views/login/index.vue")
	},
    {
        path:"/homepage",
        name:"home",
        redirect:"/homepage",
        component:()=>import("@/views/home/index.vue"),
        children:[
            {
                path:"",
                name:"homepage",
                component:()=>import("@/views/home/homepage.vue")
            },
            {
                path:"/news",
                name:"news",
                component:()=>import("@/views/news/index.vue")
            },
            {
                path:"/course",
                name:"course",
                component:()=>import("@/views/course/index.vue")
            },
            {
                path:"/check",
                name:"check",
                component:()=>import("@/views/check/index.vue")
            },
            {
                path:"/organization",
                name:"organization",
                component:()=>import("@/views/organization/index.vue")
            },
            {
                path:"/userInfo",
                name:"userInfo",
                component:()=>import("@/views/user/index.vue")
            }
        ]
    }
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
